package com.sss.service.impl;

import com.sss.entity.WmWarehouse;
import com.sss.mapper.WmWarehouseMapper;
import com.sss.service.WmWarehouseService;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.List;
/**
 * 仓库表(WmWarehouse)表服务实现类
 *
 * @author makejava
 * @since 2023-12-14 16:55:33
 */
@Service("wmWarehouseService")
public class WmWarehouseServiceImpl implements WmWarehouseService {
    @Autowired
    private WmWarehouseMapper wmWarehouseMapper;

    /**
     * 通过ID查询单条数据
     *
     * @param warehouseId 主键
     * @return 实例对象
     */
    @Override
    public WmWarehouse queryById(Long warehouseId) {
        return this.wmWarehouseMapper.queryById(warehouseId);
    }

    /**
     * 分页查询
     *
     * @return 查询结果
     */
    @Override
    public List<WmWarehouse> queryByPage(Long pageNum) {
        return this.wmWarehouseMapper.queryAllByLimit();
    }

    /**
     * 新增数据
     *
     * @param wmWarehouse 实例对象
     * @return 实例对象
     */
    @Override
    public int insert(WmWarehouse wmWarehouse) {
        return this.wmWarehouseMapper.insert(wmWarehouse);
    }

    /**
     * 修改数据
     *
     * @param wmWarehouse 实例对象
     * @return 实例对象
     */
    @Override
    public int update(WmWarehouse wmWarehouse) {
        return this.wmWarehouseMapper.update(wmWarehouse);
    }

    /**
     * 通过主键删除数据
     *
     * @param warehouseId 主键
     * @return 是否成功
     */
    @Override
    public boolean deleteById(Long warehouseId) {
        return this.wmWarehouseMapper.deleteById(warehouseId) > 0;
    }
}
